import request from '@/utils/request'
// 获取所有对象
export function getAllStudents() {
  return request({
    url: '/api/Student/getAllStudents',
    method: 'get'
  })
}
// 根据ID获取对象
export function getStudentById(id) {
  return request({
    url: '/api/Student/getStudentsById',
    method: 'post',
    params: { id: id }
  })
}
// 分页获取对象
export function getStudentsByPage(page, size) {
  return request({
    url: '/api/Student/getStudentsByPage',
    method: 'post',
    params: { page: page, size: size }
  })
}
// 分页倒序获取对象
export function getStudentsByPageDesc(page, size) {
  return request({
    url: '/api/Student/getStudentsByPageDesc',
    method: 'post',
    params: { page: page, size: size }
  })
}
// 新增&&更新对象
export function saveStudent(Student) {
  return request({
    url: '/api/Student/saveStudent',
    method: 'post',
    data: Student,
    header: {
      'Content-Type': 'application/json'
    }
  })
}
// 批量新增&&更新对象
export function saveStudents(Students) {
  return request({
    url: '/api/Student/saveStudents',
    method: 'post',
    data: Students,
    header: {
      'Content-Type': 'application/json'
    }
  })
}
// 根据Id删除对象
export function deleteStudentById(id) {
  return request({
    url: '/api/Student/deleteStudentById',
    method: 'post',
    params: { id: id }
  })
}
// 删除对象
export function deleteStudent(Student) {
  return request({
    url: '/api/Student/deleteStudent',
    method: 'post',
    data: Student,
    header: {
      'Content-Type': 'application/json'
    }
  })
}
